import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { PayOrderVO, PayOrderQuery } from '@/api/retail/payOrder/types';

/**
 * 查询支付订单列表
 * @param query
 * @returns {*}
 */

export const listPayOrder = (query?: PayOrderQuery): AxiosPromise<PayOrderVO[]> => {
  return request({
    url: '/shop/payOrder/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询支付订单详细
 * @param id
 */
export const getPayOrder = (id: string | number): AxiosPromise<PayOrderVO> => {
  return request({
    url: '/shop/payOrder/' + id,
    method: 'get'
  });
};

export const confirmPayed = (orderNo?: string | undefined) => {
  return request({
    url: '/shop/payOrder/confirm/' + orderNo,
    method: 'get'
  });
}
